// 分布式系统搭建并抽象化尝试
package main

import (
	"flag"
	"fmt"
	"mediator/demo"
)

func main() {
	var demoName string
	flag.StringVar(&demoName, "demo", "", "测试模块")
	flag.Parse()

	if demoName == "" {
		fmt.Println("请输入参数，如：-demo=grpc")
		return
	}

	demoHandler, has := demo.GetDemoHandler(demoName)
	if !has {
		fmt.Printf("未找到 %s 包\n", demoName)
		return
	}

	demoHandler.Exec()
}
